package com.zijiebutiao.utils;

import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @Date 2023/3/3 20:11
 * @Author 时间刺客
 */
public class ThreadPoolUtils {
    private ThreadPoolUtils(){}

    private static ThreadPoolExecutor threadPoolExecutor=
            new ThreadPoolExecutor(
                    5,
                    5,
                    0,
                    TimeUnit.SECONDS,
                    new LinkedBlockingQueue<>(),
                    Executors.defaultThreadFactory(),
                    new ThreadPoolExecutor.AbortPolicy());

    public static  ThreadPoolExecutor threadPoolExecutor(){
        return threadPoolExecutor;
    }
}
